<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2021/12/14
 * Time: 10:15
 */

include_once '../tools/DbTools.php';

session_start();
$token=$_COOKIE['Token'];
$username=$_SESSION[$token]['uesrname'];
$out_money=$_POST['out_money'];
$sql="update bankcard set CardMoney=CardMoney- ".$out_money." where CardNo='".$username."'";
DbTools::InitDb();
$result=DbTools::noSelect($sql);
$flag=$result['status'];
?>

<!DOCTYPE html>
<html>
<script type="text/javascript">
    if(<?php echo $flag ?>){
        alert('取钱成功！');
        location.href='../user/userinfo.php';
    }else{

    }
</script>
</html>


